using ImageCSharp.Core.Models;

namespace ImageCSharp.Core.Interfaces
{
    /// <summary>
    /// 工具服务接口
    /// </summary>
    public interface IToolService
    {
        /// <summary>
        /// 选择工具
        /// </summary>
        void SelectTool(Tool tool);

        /// <summary>
        /// 获取当前选中的工具
        /// </summary>
        Tool? GetSelectedTool();

        /// <summary>
        /// 获取所有可用工具
        /// </summary>
        List<Tool> GetAvailableTools();

        /// <summary>
        /// 执行工具操作
        /// </summary>
        void ExecuteToolAction(ImageDocument document, ToolAction action);
    }

    /// <summary>
    /// 工具操作
    /// </summary>
    public class ToolAction
    {
        public ToolActionType Type { get; set; }
        public Dictionary<string, object> Parameters { get; set; } = new();
        public SixLabors.ImageSharp.Point StartPoint { get; set; }
        public SixLabors.ImageSharp.Point EndPoint { get; set; }
        public SixLabors.ImageSharp.Point CurrentPoint { get; set; }
    }

    /// <summary>
    /// 工具操作类型
    /// </summary>
    public enum ToolActionType
    {
        MouseDown,
        MouseMove,
        MouseUp,
        KeyDown,
        KeyUp
    }
}